﻿using System;
using Rhino.Mocks;

namespace AutoMock.Frameworks.RhinoMocks
{
    internal class RhinoMocksProvider : IMockingFrameworkProvider<MockRepository>
    {
        public MockRepository Repository { get; set; }

        public RhinoMocksProvider()
        {
            Repository = new MockRepository();
        }

        public object CreateStub(Type type)
        {
            var instance = Repository.DynamicMock(type, null);
            Repository.Replay(instance);

            return instance;
        }
    }
}
